package com.fr.dialog.core;

import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.Inter;
import com.fr.base.Style;
import com.fr.base.core.ComparatorUtils;
import com.fr.base.core.GraphHelper;
import com.fr.cell.GridSelection;
import com.fr.cell.ReportPane;
import com.fr.cell.core.GUIConstants;
import com.fr.cell.core.layout.LayoutFactory;
import com.fr.dialog.BasicPane;
import com.fr.report.CellElement;
import com.fr.report.DefaultCellElement;
import com.fr.report.FloatElement;
import com.fr.report.Report;
import com.fr.report.TemplateReport;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JToggleButton;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;

public class BorderPane extends BasicPane
{
  private static final int NO_BORDERS = 0;
  private static final int EXTERNAL_BORDERS = 1;
  private static final int INSIDE_BORDERS = 2;
  private static final int TOP_BORDER = 3;
  private static final int LEFT_BORDER = 4;
  private static final int BOTTOM_BORDER = 5;
  private static final int RIGHT_BORDER = 6;
  private static final int VERTICAL_BORDER = 7;
  private static final int HORIZONTAL_BORDER = 8;
  private boolean insideMode = false;
  private CellBorderStyle cellBorderStyle = new CellBorderStyle();
  private BorderButton insideBorderButton;
  private BorderComponent borderComponent;
  private JToggleButton topToggleButton;
  private JToggleButton horizontalToggleButton;
  private JToggleButton bottomToggleButton;
  private JToggleButton leftToggleButton;
  private JToggleButton verticalToggleButton;
  private JToggleButton rightToggleButton;
  private LineComboBox currentLineCombo;
  private ColorSelectionPane currentLineColorPane;
  private EventListenerList eventChangeList = new EventListenerList();
  ActionListener actionListener = new ActionListener(this)
  {
    private final BorderPane this$0;

    public void actionPerformed()
    {
      this.this$0.fireStateChanged();
    }
  };

  public BorderPane()
  {
    initComponents();
  }

  protected void initComponents()
  {
    setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    setLayout(new BorderLayout());
    JPanel localJPanel1 = new JPanel();
    add(localJPanel1, "Center");
    localJPanel1.setLayout(new BorderLayout(4, 0));
    JPanel localJPanel2 = new JPanel();
    localJPanel1.add(localJPanel2, "Center");
    localJPanel2.setLayout(new BorderLayout(0, 2));
    localJPanel2.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("Preview") + ":"));
    JPanel localJPanel3 = new JPanel(new FlowLayout(1, 16, 0));
    localJPanel2.add(localJPanel3, "North");
    localJPanel3.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0));
    localJPanel3.add(new JLabel(" "));
    BorderButtonIcon localBorderButtonIcon1 = new BorderButtonIcon(this, 0, null);
    BorderButton localBorderButton1 = new BorderButton(this, localBorderButtonIcon1, null);
    localBorderButton1.addActionListener(this.actionListener);
    localBorderButton1.addActionListener(new ActionListener(this)
    {
      private final BorderPane this$0;

      public void actionPerformed()
      {
        BorderPane.BorderComponent.access$300(BorderPane.access$200(this.this$0), 0);
        BorderPane.access$400(this.this$0).setTopColor(Color.BLACK);
        BorderPane.access$400(this.this$0).setTopStyle(0);
        BorderPane.access$400(this.this$0).setHorizontalColor(Color.BLACK);
        BorderPane.access$400(this.this$0).setHorizontalStyle(0);
        BorderPane.access$400(this.this$0).setBottomColor(Color.BLACK);
        BorderPane.access$400(this.this$0).setBottomStyle(0);
        BorderPane.access$400(this.this$0).setLeftColor(Color.BLACK);
        BorderPane.access$400(this.this$0).setLeftStyle(0);
        BorderPane.access$400(this.this$0).setVerticalColor(Color.BLACK);
        BorderPane.access$400(this.this$0).setVerticalStyle(0);
        BorderPane.access$400(this.this$0).setRightColor(Color.BLACK);
        BorderPane.access$400(this.this$0).setRightStyle(0);
        BorderPane.access$500(this.this$0);
        BorderPane.access$200(this.this$0).repaint();
      }
    });
    localJPanel3.add(createVerButtonPane(localBorderButton1, Inter.getLocText("No")));
    BorderButtonIcon localBorderButtonIcon2 = new BorderButtonIcon(this, 1, null);
    BorderButton localBorderButton2 = new BorderButton(this, localBorderButtonIcon2, null);
    localBorderButton2.addActionListener(this.actionListener);
    localBorderButton2.addActionListener(new ActionListener(this)
    {
      private final BorderPane this$0;

      public void actionPerformed()
      {
        BorderPane.BorderComponent.access$300(BorderPane.access$200(this.this$0), 1);
        BorderPane.access$400(this.this$0).setTopColor(BorderPane.access$600(this.this$0).getColor());
        BorderPane.access$400(this.this$0).setTopStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
        BorderPane.access$400(this.this$0).setBottomColor(BorderPane.access$600(this.this$0).getColor());
        BorderPane.access$400(this.this$0).setBottomStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
        BorderPane.access$400(this.this$0).setLeftColor(BorderPane.access$600(this.this$0).getColor());
        BorderPane.access$400(this.this$0).setLeftStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
        BorderPane.access$400(this.this$0).setRightColor(BorderPane.access$600(this.this$0).getColor());
        BorderPane.access$400(this.this$0).setRightStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
        BorderPane.access$500(this.this$0);
        BorderPane.access$200(this.this$0).repaint();
      }
    });
    localJPanel3.add(createVerButtonPane(localBorderButton2, Inter.getLocText("External")));
    BorderButtonIcon localBorderButtonIcon3 = new BorderButtonIcon(this, 2, null);
    this.insideBorderButton = new BorderButton(this, localBorderButtonIcon3, null);
    this.insideBorderButton.addActionListener(new ActionListener(this)
    {
      private final BorderPane this$0;

      public void actionPerformed()
      {
        BorderPane.BorderComponent.access$300(BorderPane.access$200(this.this$0), 2);
        BorderPane.access$400(this.this$0).setHorizontalColor(BorderPane.access$600(this.this$0).getColor());
        BorderPane.access$400(this.this$0).setHorizontalStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
        BorderPane.access$400(this.this$0).setVerticalColor(BorderPane.access$600(this.this$0).getColor());
        BorderPane.access$400(this.this$0).setVerticalStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
        BorderPane.access$500(this.this$0);
        BorderPane.access$200(this.this$0).repaint();
      }
    });
    localJPanel3.add(createVerButtonPane(this.insideBorderButton, Inter.getLocText("Inside")));
    JPanel localJPanel4 = new JPanel();
    localJPanel2.add(localJPanel4, "Center");
    localJPanel4.setLayout(new BorderLayout(0, 2));
    localJPanel4.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 4));
    this.borderComponent = new BorderComponent(this, null);
    this.borderComponent.addBorderChangeListener(new ChangeListener(this)
    {
      private final BorderPane this$0;

      public void stateChanged()
      {
        this.this$0.fireStateChanged();
      }
    });
    localJPanel4.add(this.borderComponent, "Center");
    JPanel localJPanel5 = new JPanel();
    JPanel localJPanel6 = new JPanel();
    JPanel localJPanel7 = new JPanel();
    localJPanel4.add(localJPanel5, "West");
    JPanel localJPanel8 = new JPanel();
    localJPanel8.setLayout(LayoutFactory.createBorderLayout());
    localJPanel4.add(localJPanel8, "South");
    localJPanel8.add(localJPanel7, "Center");
    localJPanel8.add(localJPanel6, "West");
    localJPanel5.setLayout(new VerticalFlowLayout(1, 4, 16));
    this.topToggleButton = new ToggleButton(this, BaseUtils.readIcon("/com/fr/dialog/images/border/top.png"), 3);
    this.horizontalToggleButton = new ToggleButton(this, BaseUtils.readIcon("/com/fr/dialog/images/border/horizontal.png"), 8);
    this.bottomToggleButton = new ToggleButton(this, BaseUtils.readIcon("/com/fr/dialog/images/border/bottom.png"), 5);
    this.leftToggleButton = new ToggleButton(this, BaseUtils.readIcon("/com/fr/dialog/images/border/left.png"), 4);
    this.verticalToggleButton = new ToggleButton(this, BaseUtils.readIcon("/com/fr/dialog/images/border/vertical.png"), 7);
    this.rightToggleButton = new ToggleButton(this, BaseUtils.readIcon("/com/fr/dialog/images/border/right.png"), 6);
    localJPanel5.add(this.topToggleButton);
    localJPanel5.add(this.horizontalToggleButton);
    localJPanel5.add(this.bottomToggleButton);
    localJPanel7.setLayout(new FlowLayout(1, 42, 5));
    localJPanel7.add(this.leftToggleButton);
    localJPanel7.add(this.verticalToggleButton);
    localJPanel7.add(this.rightToggleButton);
    localJPanel6.setPreferredSize(new Dimension(localJPanel5.getPreferredSize().width, localJPanel7.getPreferredSize().height));
    JPanel localJPanel9 = new JPanel();
    localJPanel1.add(localJPanel9, "West");
    localJPanel9.setLayout(LayoutFactory.createBorderLayout());
    localJPanel9.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("Line") + ":"));
    JPanel localJPanel10 = new JPanel();
    localJPanel9.add(localJPanel10, "North");
    localJPanel10.setLayout(new GridLayout(4, 1, 2, 2));
    localJPanel10.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2));
    localJPanel10.add(new JLabel(Inter.getLocText("Style") + ":"));
    this.currentLineCombo = new LineComboBox(GUIConstants.BorderlineStyleArray);
    localJPanel10.add(this.currentLineCombo);
    localJPanel10.add(new JLabel(Inter.getLocText("Color") + ":"));
    this.currentLineColorPane = new ColorSelectionPane(100);
    localJPanel10.add(this.currentLineColorPane);
    this.currentLineColorPane.setColor(Color.BLACK);
  }

  public void addChangeListener(ChangeListener paramChangeListener)
  {
    this.eventChangeList.add(ChangeListener.class, paramChangeListener);
  }

  public void fireStateChanged()
  {
    Object[] arrayOfObject = this.eventChangeList.getListenerList();
    ChangeEvent localChangeEvent = null;
    for (int i = arrayOfObject.length - 2; i >= 0; i -= 2)
      if (arrayOfObject[i] == ChangeListener.class)
      {
        if (localChangeEvent == null)
          localChangeEvent = new ChangeEvent(this);
        ((ChangeListener)arrayOfObject[(i + 1)]).stateChanged(localChangeEvent);
      }
  }

  private JPanel createVerButtonPane(JComponent paramJComponent, String paramString)
  {
    JPanel localJPanel = new JPanel();
    localJPanel.setLayout(new VerticalFlowLayout(1, 2, 2));
    localJPanel.add(paramJComponent);
    localJPanel.add(new JLabel(paramString));
    return localJPanel;
  }

  private void refreshAllToggleButtons()
  {
    this.topToggleButton.setSelected(this.cellBorderStyle.getTopStyle() != 0);
    this.horizontalToggleButton.setSelected(this.cellBorderStyle.getHorizontalStyle() != 0);
    this.bottomToggleButton.setSelected(this.cellBorderStyle.getBottomStyle() != 0);
    this.leftToggleButton.setSelected(this.cellBorderStyle.getLeftStyle() != 0);
    this.verticalToggleButton.setSelected(this.cellBorderStyle.getVerticalStyle() != 0);
    this.rightToggleButton.setSelected(this.cellBorderStyle.getRightStyle() != 0);
  }

  public CellBorderStyle getCellBorderStyle()
  {
    return this.cellBorderStyle;
  }

  public void setCellBorderStyle(CellBorderStyle paramCellBorderStyle)
  {
    this.cellBorderStyle = paramCellBorderStyle;
  }

  public void populate(ReportPane paramReportPane)
  {
    Object[] arrayOfObject = createCellBorderObject(paramReportPane);
    if ((arrayOfObject != null) && (arrayOfObject.length == 4))
      populate((CellBorderStyle)arrayOfObject[0], ((Boolean)arrayOfObject[1]).booleanValue(), ((Integer)arrayOfObject[2]).intValue(), (Color)arrayOfObject[3]);
  }

  public void populate(Style paramStyle)
  {
    if (paramStyle == null)
      paramStyle = Style.DEFAULT_STYLE;
    CellBorderStyle localCellBorderStyle = new CellBorderStyle();
    localCellBorderStyle.setTopStyle(paramStyle.getBorderTop());
    localCellBorderStyle.setTopColor(paramStyle.getBorderTopColor());
    localCellBorderStyle.setLeftStyle(paramStyle.getBorderLeft());
    localCellBorderStyle.setLeftColor(paramStyle.getBorderLeftColor());
    localCellBorderStyle.setBottomStyle(paramStyle.getBorderBottom());
    localCellBorderStyle.setBottomColor(paramStyle.getBorderBottomColor());
    localCellBorderStyle.setRightStyle(paramStyle.getBorderRight());
    localCellBorderStyle.setRightColor(paramStyle.getBorderRightColor());
    populate(localCellBorderStyle, false, paramStyle.getBorderTop(), paramStyle.getBorderTopColor());
  }

  public void populate(CellBorderStyle paramCellBorderStyle, boolean paramBoolean, int paramInt, Color paramColor)
  {
    try
    {
      if (paramCellBorderStyle != null)
        this.cellBorderStyle = ((CellBorderStyle)paramCellBorderStyle.clone());
    }
    catch (CloneNotSupportedException localCloneNotSupportedException)
    {
      FRContext.getLogger().log(Level.WARNING, localCloneNotSupportedException.getMessage(), localCloneNotSupportedException);
    }
    this.insideMode = paramBoolean;
    this.currentLineCombo.setSelectedLineStyle((paramInt == 0) ? 1 : paramInt);
    this.currentLineColorPane.setColor(paramColor);
    this.insideBorderButton.setEnabled(this.insideMode);
    this.horizontalToggleButton.setEnabled(this.insideMode);
    this.verticalToggleButton.setEnabled(this.insideMode);
    this.borderComponent.repaint();
  }

  public boolean update(ReportPane paramReportPane)
  {
    int i = 0;
    Object[] arrayOfObject = createCellBorderObject(paramReportPane);
    if ((arrayOfObject == null) || (arrayOfObject.length < 4))
      return false;
    CellBorderStyle localCellBorderStyle1 = (CellBorderStyle)arrayOfObject[0];
    CellBorderStyle localCellBorderStyle2 = update();
    TemplateReport localTemplateReport = paramReportPane.getEditingReport();
    GridSelection localGridSelection = paramReportPane.getGridSelection();
    int j = localGridSelection.getType();
    if (j == 1)
    {
      FloatElement localFloatElement = localTemplateReport.getFloatElement(localGridSelection.getLastFloatName());
      if (!(ComparatorUtils.equals(localCellBorderStyle1, localCellBorderStyle2)))
      {
        i = 1;
        Style localStyle1 = localFloatElement.getStyle();
        localFloatElement.setStyle(localStyle1.deriveBorder(localCellBorderStyle2.getTopStyle(), localCellBorderStyle2.getTopColor(), localCellBorderStyle2.getBottomStyle(), localCellBorderStyle2.getBottomColor(), localCellBorderStyle2.getLeftStyle(), localCellBorderStyle2.getLeftColor(), localCellBorderStyle2.getRightStyle(), localCellBorderStyle2.getRightColor()));
      }
      return i;
    }
    int k = localGridSelection.getCellRectangleCount();
    for (int l = 0; l < k; ++l)
    {
      int i5;
      Rectangle localRectangle = localGridSelection.getCellRectangle(l);
      int i1 = localRectangle.x;
      int i2 = localRectangle.y;
      int i3 = localRectangle.width;
      int i4 = localRectangle.height;
      if (!(ComparatorUtils.equals(localCellBorderStyle1, localCellBorderStyle2)))
      {
        i = 1;
        for (i5 = i1; i5 < i1 + i3; ++i5)
          for (int i6 = i2; i6 < i2 + i4; ++i6)
          {
            Object localObject = localTemplateReport.getCellElement(i5, i6);
            if (localObject == null)
            {
              localObject = new DefaultCellElement(i5, i6);
              localTemplateReport.addCellElement((CellElement)localObject);
            }
            Style localStyle2 = ((CellElement)localObject).getStyle();
            if (((CellElement)localObject).getColumn() == i1)
              if ((localCellBorderStyle1.getLeftStyle() != localCellBorderStyle2.getLeftStyle()) || (!(ComparatorUtils.equals(localCellBorderStyle1.getLeftColor(), localCellBorderStyle2.getLeftColor()))))
                localStyle2 = localStyle2.deriveBorderLeft(localCellBorderStyle2.getLeftStyle(), localCellBorderStyle2.getLeftColor());
            else if ((localCellBorderStyle1.getVerticalStyle() != localCellBorderStyle2.getVerticalStyle()) || (!(ComparatorUtils.equals(localCellBorderStyle1.getVerticalColor(), localCellBorderStyle2.getVerticalColor()))))
              localStyle2 = localStyle2.deriveBorderLeft(localCellBorderStyle2.getVerticalStyle(), localCellBorderStyle2.getVerticalColor());
            if (((CellElement)localObject).getColumn() + ((CellElement)localObject).getColumnSpan() == i1 + i3)
              if ((localCellBorderStyle1.getRightStyle() != localCellBorderStyle2.getRightStyle()) || (!(ComparatorUtils.equals(localCellBorderStyle1.getRightColor(), localCellBorderStyle2.getRightColor()))))
                localStyle2 = localStyle2.deriveBorderRight(localCellBorderStyle2.getRightStyle(), localCellBorderStyle2.getRightColor());
            else if ((localCellBorderStyle1.getVerticalStyle() != localCellBorderStyle2.getVerticalStyle()) || (!(ComparatorUtils.equals(localCellBorderStyle1.getVerticalColor(), localCellBorderStyle2.getVerticalColor()))))
              localStyle2 = localStyle2.deriveBorderRight(localCellBorderStyle2.getVerticalStyle(), localCellBorderStyle2.getVerticalColor());
            if (((CellElement)localObject).getRow() == i2)
              if ((localCellBorderStyle1.getTopStyle() != localCellBorderStyle2.getTopStyle()) || (!(ComparatorUtils.equals(localCellBorderStyle1.getTopColor(), localCellBorderStyle2.getTopColor()))))
                localStyle2 = localStyle2.deriveBorderTop(localCellBorderStyle2.getTopStyle(), localCellBorderStyle2.getTopColor());
            else if ((localCellBorderStyle1.getHorizontalStyle() != localCellBorderStyle2.getHorizontalStyle()) || (!(ComparatorUtils.equals(localCellBorderStyle1.getHorizontalColor(), localCellBorderStyle2.getHorizontalColor()))))
              localStyle2 = localStyle2.deriveBorderTop(localCellBorderStyle2.getHorizontalStyle(), localCellBorderStyle2.getHorizontalColor());
            if (((CellElement)localObject).getRow() + ((CellElement)localObject).getRowSpan() == i2 + i4)
              if ((localCellBorderStyle1.getBottomStyle() != localCellBorderStyle2.getBottomStyle()) || (!(ComparatorUtils.equals(localCellBorderStyle1.getBottomColor(), localCellBorderStyle2.getBottomColor()))))
                localStyle2 = localStyle2.deriveBorderBottom(localCellBorderStyle2.getBottomStyle(), localCellBorderStyle2.getBottomColor());
            else if ((localCellBorderStyle1.getHorizontalStyle() != localCellBorderStyle2.getHorizontalStyle()) || (!(ComparatorUtils.equals(localCellBorderStyle1.getHorizontalColor(), localCellBorderStyle2.getHorizontalColor()))))
              localStyle2 = localStyle2.deriveBorderBottom(localCellBorderStyle2.getHorizontalStyle(), localCellBorderStyle2.getHorizontalColor());
            ((CellElement)localObject).setStyle(localStyle2);
          }
      }
    }
    return i;
  }

  public Style update(Style paramStyle)
  {
    if (paramStyle == null)
      paramStyle = Style.DEFAULT_STYLE;
    CellBorderStyle localCellBorderStyle = update();
    paramStyle = paramStyle.deriveBorder(localCellBorderStyle.getTopStyle(), localCellBorderStyle.getTopColor(), localCellBorderStyle.getBottomStyle(), localCellBorderStyle.getBottomColor(), localCellBorderStyle.getLeftStyle(), localCellBorderStyle.getLeftColor(), localCellBorderStyle.getRightStyle(), localCellBorderStyle.getRightColor());
    return paramStyle;
  }

  public CellBorderStyle update()
  {
    return this.cellBorderStyle;
  }

  private boolean isAllEquals(List paramList)
  {
    for (int i = 0; i + 1 < paramList.size(); ++i)
      if (!(ComparatorUtils.equals(paramList.get(i), paramList.get(i + 1))))
        return false;
    return true;
  }

  private Object[] createCellBorderObject(ReportPane paramReportPane)
  {
    Object localObject1;
    CellBorderStyle localCellBorderStyle = new CellBorderStyle();
    int i = 0;
    TemplateReport localTemplateReport = paramReportPane.getEditingReport();
    GridSelection localGridSelection = paramReportPane.getGridSelection();
    int j = localGridSelection.getType();
    if (j == 1)
    {
      localObject1 = localTemplateReport.getFloatElement(localGridSelection.getLastFloatName());
      Style localStyle = ((FloatElement)localObject1).getStyle();
      localCellBorderStyle.setTopColor(localStyle.getBorderTopColor());
      localCellBorderStyle.setTopStyle(localStyle.getBorderTop());
      localCellBorderStyle.setLeftColor(localStyle.getBorderLeftColor());
      localCellBorderStyle.setLeftStyle(localStyle.getBorderLeft());
      localCellBorderStyle.setBottomColor(localStyle.getBorderBottomColor());
      localCellBorderStyle.setBottomStyle(localStyle.getBorderBottom());
      localCellBorderStyle.setRightColor(localStyle.getBorderRightColor());
      label333: label470: label604: label738: label1150: localCellBorderStyle.setRightStyle(localStyle.getBorderRight());
    }
    else
    {
      Object localObject5;
      int i5;
      Object localObject6;
      localObject1 = localGridSelection.getLastCellRectangle();
      Object localObject2 = ((Rectangle)localObject1).x;
      Object localObject3 = ((Rectangle)localObject1).y;
      int l = ((Rectangle)localObject1).width;
      int i1 = ((Rectangle)localObject1).height;
      Hashtable localHashtable1 = new Hashtable();
      Hashtable localHashtable2 = new Hashtable();
      Hashtable localHashtable3 = new Hashtable();
      Hashtable localHashtable4 = new Hashtable();
      if (localObject3 - 1 >= 0)
        for (i2 = localObject2; i2 < localObject2 + l; ++i2)
        {
          localObject4 = localTemplateReport.getCellElement(i2, localObject3 - 1);
          if (localObject4 == null)
            break label333:
          localObject5 = ((CellElement)localObject4).getStyle();
          if (((Style)localObject5).getBorderBottom() != 0)
            for (i5 = ((CellElement)localObject4).getColumn(); i5 < ((CellElement)localObject4).getColumn() + ((CellElement)localObject4).getColumnSpan(); ++i5)
              localHashtable2.put(new ColumnRow(i5, localObject3, false), new BorderStyleColor(((Style)localObject5).getBorderBottom(), ((Style)localObject5).getBorderBottomColor()));
        }
      if (localObject2 - 1 >= 0)
        for (i2 = localObject3; i2 < localObject3 + i1; ++i2)
        {
          localObject4 = localTemplateReport.getCellElement(localObject2 - 1, i2);
          if (localObject4 == null)
            break label470:
          localObject5 = ((CellElement)localObject4).getStyle();
          if (((Style)localObject5).getBorderRight() != 0)
            for (i5 = ((CellElement)localObject4).getRow(); i5 < ((CellElement)localObject4).getRow() + ((CellElement)localObject4).getRowSpan(); ++i5)
              localHashtable4.put(new ColumnRow(localObject2, i5, true), new BorderStyleColor(((Style)localObject5).getBorderRight(), ((Style)localObject5).getBorderRightColor()));
        }
      for (int i2 = localObject2; i2 < localObject2 + l; ++i2)
      {
        localObject4 = localTemplateReport.getCellElement(i2, localObject3 + i1);
        if (localObject4 == null)
          break label604:
        localObject5 = ((CellElement)localObject4).getStyle();
        if (((Style)localObject5).getBorderTop() != 0)
          for (i5 = ((CellElement)localObject4).getColumn(); i5 < ((CellElement)localObject4).getColumn() + ((CellElement)localObject4).getColumnSpan(); ++i5)
            localHashtable1.put(new ColumnRow(i5, localObject3 + i1, false), new BorderStyleColor(((Style)localObject5).getBorderTop(), ((Style)localObject5).getBorderTopColor()));
      }
      for (i2 = localObject3; i2 < localObject3 + i1; ++i2)
      {
        localObject4 = localTemplateReport.getCellElement(localObject2 + l, i2);
        if (localObject4 == null)
          break label738:
        localObject5 = ((CellElement)localObject4).getStyle();
        if (((Style)localObject5).getBorderLeft() != 0)
          for (i5 = ((CellElement)localObject4).getRow(); i5 < ((CellElement)localObject4).getRow() + ((CellElement)localObject4).getRowSpan(); ++i5)
            localHashtable3.put(new ColumnRow(localObject2 + l, i5, true), new BorderStyleColor(((Style)localObject5).getBorderLeft(), ((Style)localObject5).getBorderLeftColor()));
      }
      for (i2 = localObject2; i2 < localObject2 + l; ++i2)
        for (localObject4 = localObject3; localObject4 < localObject3 + i1; ++localObject4)
        {
          int i6;
          localObject5 = localTemplateReport.getCellElement(i2, localObject4);
          if (localObject5 == null)
            break label1150:
          localObject6 = ((CellElement)localObject5).getStyle();
          if (((Style)localObject6).getBorderTop() != 0)
            for (i6 = ((CellElement)localObject5).getColumn(); i6 < ((CellElement)localObject5).getColumn() + ((CellElement)localObject5).getColumnSpan(); ++i6)
              localHashtable1.put(new ColumnRow(i6, ((CellElement)localObject5).getRow(), false), new BorderStyleColor(((Style)localObject6).getBorderTop(), ((Style)localObject6).getBorderTopColor()));
          if (((Style)localObject6).getBorderLeft() != 0)
            for (i6 = ((CellElement)localObject5).getRow(); i6 < ((CellElement)localObject5).getRow() + ((CellElement)localObject5).getRowSpan(); ++i6)
              localHashtable3.put(new ColumnRow(((CellElement)localObject5).getColumn(), i6, true), new BorderStyleColor(((Style)localObject6).getBorderLeft(), ((Style)localObject6).getBorderLeftColor()));
          if (((Style)localObject6).getBorderBottom() != 0)
            for (i6 = ((CellElement)localObject5).getColumn(); i6 < ((CellElement)localObject5).getColumn() + ((CellElement)localObject5).getColumnSpan(); ++i6)
              localHashtable2.put(new ColumnRow(i6, ((CellElement)localObject5).getRow() + ((CellElement)localObject5).getRowSpan(), false), new BorderStyleColor(((Style)localObject6).getBorderBottom(), ((Style)localObject6).getBorderBottomColor()));
          if (((Style)localObject6).getBorderRight() != 0)
            for (i6 = ((CellElement)localObject5).getRow(); i6 < ((CellElement)localObject5).getRow() + ((CellElement)localObject5).getRowSpan(); ++i6)
              localHashtable4.put(new ColumnRow(((CellElement)localObject5).getColumn() + ((CellElement)localObject5).getColumnSpan(), i6, true), new BorderStyleColor(((Style)localObject6).getBorderRight(), ((Style)localObject6).getBorderRightColor()));
        }
      ArrayList localArrayList = new ArrayList();
      for (Object localObject4 = localObject2; localObject4 < localObject2 + l; ++localObject4)
      {
        localObject5 = (BorderStyleColor)localHashtable1.get(new ColumnRow(localObject4, localObject3, false));
        localArrayList.add(localObject5);
      }
      if (localArrayList.size() > 0)
        if (isAllEquals(localArrayList))
        {
          localObject4 = (BorderStyleColor)localArrayList.get(0);
          if (localObject4 != null)
          {
            localCellBorderStyle.setTopColor(((BorderStyleColor)localObject4).getColor());
            localCellBorderStyle.setTopStyle(((BorderStyleColor)localObject4).getStyle());
          }
        }
        else
        {
          localCellBorderStyle.setTopColor(Color.GRAY);
          localCellBorderStyle.setTopStyle(15);
        }
      localArrayList.clear();
      for (localObject4 = localObject3; localObject4 < localObject3 + i1; ++localObject4)
      {
        localObject5 = (BorderStyleColor)localHashtable3.get(new ColumnRow(localObject2, localObject4, true));
        localArrayList.add(localObject5);
      }
      if (localArrayList.size() > 0)
        if (isAllEquals(localArrayList))
        {
          localObject4 = (BorderStyleColor)localArrayList.get(0);
          if (localObject4 != null)
          {
            localCellBorderStyle.setLeftColor(((BorderStyleColor)localObject4).getColor());
            localCellBorderStyle.setLeftStyle(((BorderStyleColor)localObject4).getStyle());
          }
        }
        else
        {
          localCellBorderStyle.setLeftColor(Color.GRAY);
          localCellBorderStyle.setLeftStyle(15);
        }
      localArrayList.clear();
      for (localObject4 = localObject2; localObject4 < localObject2 + l; ++localObject4)
      {
        localObject5 = (BorderStyleColor)localHashtable2.get(new ColumnRow(localObject4, localObject3 + i1, false));
        localArrayList.add(localObject5);
      }
      if (localArrayList.size() > 0)
        if (isAllEquals(localArrayList))
        {
          localObject4 = (BorderStyleColor)localArrayList.get(0);
          if (localObject4 != null)
          {
            localCellBorderStyle.setBottomColor(((BorderStyleColor)localObject4).getColor());
            localCellBorderStyle.setBottomStyle(((BorderStyleColor)localObject4).getStyle());
          }
        }
        else
        {
          localCellBorderStyle.setBottomColor(Color.GRAY);
          localCellBorderStyle.setBottomStyle(15);
        }
      localArrayList.clear();
      for (localObject4 = localObject3; localObject4 < localObject3 + i1; ++localObject4)
      {
        localObject5 = (BorderStyleColor)localHashtable4.get(new ColumnRow(localObject2 + l, localObject4, true));
        localArrayList.add(localObject5);
      }
      if (localArrayList.size() > 0)
        if (isAllEquals(localArrayList))
        {
          localObject4 = (BorderStyleColor)localArrayList.get(0);
          if (localObject4 != null)
          {
            localCellBorderStyle.setRightColor(((BorderStyleColor)localObject4).getColor());
            localCellBorderStyle.setRightStyle(((BorderStyleColor)localObject4).getStyle());
          }
        }
        else
        {
          localCellBorderStyle.setRightColor(Color.GRAY);
          localCellBorderStyle.setRightStyle(15);
        }
      if ((l > 1) || (i1 > 1))
      {
        i = 1;
        localArrayList.clear();
        for (int i3 = localObject2 + 1; i3 < localObject2 + l; ++i3)
          for (localObject5 = localObject3; localObject5 < localObject3 + i1; ++localObject5)
          {
            localObject6 = (BorderStyleColor)localHashtable3.get(new ColumnRow(i3, localObject5, true));
            localArrayList.add(localObject6);
            localObject6 = (BorderStyleColor)localHashtable4.get(new ColumnRow(i3, localObject5, true));
            localArrayList.add(localObject6);
          }
        if (localArrayList.size() > 0)
          if (isAllEquals(localArrayList))
          {
            localBorderStyleColor = (BorderStyleColor)localArrayList.get(0);
            if (localBorderStyleColor != null)
            {
              localCellBorderStyle.setVerticalColor(localBorderStyleColor.getColor());
              localCellBorderStyle.setVerticalStyle(localBorderStyleColor.getStyle());
            }
          }
          else
          {
            localCellBorderStyle.setVerticalColor(Color.GRAY);
            localCellBorderStyle.setVerticalStyle(15);
          }
        localArrayList.clear();
        for (BorderStyleColor localBorderStyleColor = localObject2; localBorderStyleColor < localObject2 + l; ++localBorderStyleColor)
          for (int i4 = localObject3 + 1; i4 < localObject3 + i1; ++i4)
          {
            localObject6 = (BorderStyleColor)localHashtable1.get(new ColumnRow(localBorderStyleColor, i4, false));
            localArrayList.add(localObject6);
            localObject6 = (BorderStyleColor)localHashtable2.get(new ColumnRow(localBorderStyleColor, i4, false));
            localArrayList.add(localObject6);
          }
        if (localArrayList.size() > 0)
          if (isAllEquals(localArrayList))
          {
            localBorderStyleColor = (BorderStyleColor)localArrayList.get(0);
            if (localBorderStyleColor != null)
            {
              localCellBorderStyle.setHorizontalColor(localBorderStyleColor.getColor());
              localCellBorderStyle.setHorizontalStyle(localBorderStyleColor.getStyle());
            }
          }
          else
          {
            localCellBorderStyle.setHorizontalColor(Color.GRAY);
            localCellBorderStyle.setHorizontalStyle(15);
          }
      }
    }
    int k = 0;
    Color localColor = Color.BLACK;
    if ((localCellBorderStyle.getLeftStyle() != 0) && (localCellBorderStyle.getLeftStyle() != 15))
    {
      k = localCellBorderStyle.getLeftStyle();
      localColor = localCellBorderStyle.getLeftColor();
    }
    else if ((localCellBorderStyle.getTopStyle() != 0) && (localCellBorderStyle.getTopStyle() != 15))
    {
      k = localCellBorderStyle.getTopStyle();
      localColor = localCellBorderStyle.getTopColor();
    }
    else if ((localCellBorderStyle.getBottomStyle() != 0) && (localCellBorderStyle.getBottomStyle() != 15))
    {
      k = localCellBorderStyle.getBottomStyle();
      localColor = localCellBorderStyle.getBottomColor();
    }
    else if ((localCellBorderStyle.getRightStyle() != 0) && (localCellBorderStyle.getRightStyle() != 15))
    {
      k = localCellBorderStyle.getRightStyle();
      localColor = localCellBorderStyle.getRightColor();
    }
    else if ((localCellBorderStyle.getVerticalStyle() != 0) && (localCellBorderStyle.getVerticalStyle() != 15))
    {
      k = localCellBorderStyle.getVerticalStyle();
      localColor = localCellBorderStyle.getVerticalColor();
    }
    else if ((localCellBorderStyle.getHorizontalStyle() != 0) && (localCellBorderStyle.getHorizontalStyle() != 15))
    {
      k = localCellBorderStyle.getHorizontalStyle();
      localColor = localCellBorderStyle.getHorizontalColor();
    }
    return ((Object)(Object)(Object)(Object)(Object)(Object)new Object[] { localCellBorderStyle, (i != 0) ? Boolean.TRUE : Boolean.FALSE, new Integer(k), localColor });
  }

  static BorderComponent access$200(BorderPane paramBorderPane)
  {
    return paramBorderPane.borderComponent;
  }

  static CellBorderStyle access$400(BorderPane paramBorderPane)
  {
    return paramBorderPane.cellBorderStyle;
  }

  static void access$500(BorderPane paramBorderPane)
  {
    paramBorderPane.refreshAllToggleButtons();
  }

  static ColorSelectionPane access$600(BorderPane paramBorderPane)
  {
    return paramBorderPane.currentLineColorPane;
  }

  static LineComboBox access$700(BorderPane paramBorderPane)
  {
    return paramBorderPane.currentLineCombo;
  }

  static boolean access$1000(BorderPane paramBorderPane)
  {
    return paramBorderPane.insideMode;
  }

  private class BorderComponent extends JComponent
  {
    private boolean topActive;
    private boolean leftActive;
    private boolean bottomActive;
    private boolean rightActive;
    private boolean verticalActive;
    private boolean horizontalActive;
    private EventListenerList borderChangeListenerList;
    private final BorderPane this$0;

    private BorderComponent()
    {
      this.this$0 = paramBorderPane;
      this.topActive = false;
      this.leftActive = false;
      this.bottomActive = false;
      this.rightActive = false;
      this.verticalActive = false;
      this.horizontalActive = false;
      this.borderChangeListenerList = new EventListenerList();
      setOpaque(true);
      addMouseListener(new BorderPane.6(this));
    }

    public void paint()
    {
      int[] arrayOfInt1;
      int[] arrayOfInt2;
      paramGraphics.setColor(Color.white);
      paramGraphics.fillRect(0, 0, getWidth() - 1, getHeight() - 1);
      paramGraphics.setColor(Color.black);
      paramGraphics.drawRect(0, 0, getWidth() - 1, getHeight() - 1);
      if (this.topActive)
      {
        arrayOfInt1 = new int[] { 3, 3, 10 };
        arrayOfInt2 = new int[] { 7, 13, 10 };
        paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
      }
      else
      {
        paramGraphics.drawLine(3, 10, 10, 10);
      }
      if (this.leftActive)
      {
        arrayOfInt1 = new int[] { 7, 13, 10 };
        arrayOfInt2 = new int[] { 3, 3, 10 };
        paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
      }
      else
      {
        paramGraphics.drawLine(10, 3, 10, 10);
      }
      if (BorderPane.access$1000(this.this$0))
      {
        paramGraphics.drawLine(getWidth() / 2 - 3, 10, getWidth() / 2 + 3, 10);
        if (this.verticalActive)
        {
          arrayOfInt1 = new int[] { getWidth() / 2 - 3, getWidth() / 2 + 3, getWidth() / 2 };
          arrayOfInt2 = new int[] { 3, 3, 10 };
          paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
        }
        else
        {
          paramGraphics.drawLine(getWidth() / 2, 3, getWidth() / 2, 10);
        }
      }
      if (this.topActive)
      {
        arrayOfInt1 = new int[] { getWidth() - 3, getWidth() - 11, getWidth() - 3 };
        arrayOfInt2 = new int[] { 7, 10, 13 };
        paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
      }
      else
      {
        paramGraphics.drawLine(getWidth() - 11, 10, getWidth() - 4, 10);
      }
      if (this.rightActive)
      {
        arrayOfInt1 = new int[] { getWidth() - 14, getWidth() - 8, getWidth() - 11 };
        arrayOfInt2 = new int[] { 3, 3, 10 };
        paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
      }
      else
      {
        paramGraphics.drawLine(getWidth() - 11, 3, getWidth() - 11, 10);
      }
      if (BorderPane.access$1000(this.this$0))
      {
        paramGraphics.drawLine(getWidth() - 11, getHeight() / 2 - 3, getWidth() - 11, getHeight() / 2 + 3);
        if (this.horizontalActive)
        {
          arrayOfInt1 = new int[] { getWidth() - 3, getWidth() - 11, getWidth() - 3 };
          arrayOfInt2 = new int[] { getHeight() / 2 - 3, getHeight() / 2, getHeight() / 2 + 3 };
          paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
        }
        else
        {
          paramGraphics.drawLine(getWidth() - 11, getHeight() / 2, getWidth() - 4, getHeight() / 2);
        }
      }
      if (this.bottomActive)
      {
        arrayOfInt1 = new int[] { 3, 3, 10 };
        arrayOfInt2 = new int[] { getHeight() - 14, getHeight() - 8, getHeight() - 11 };
        paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
      }
      else
      {
        paramGraphics.drawLine(3, getHeight() - 11, 10, getHeight() - 11);
      }
      if (this.leftActive)
      {
        arrayOfInt1 = new int[] { 7, 13, 10 };
        arrayOfInt2 = new int[] { getHeight() - 3, getHeight() - 3, getHeight() - 11 };
        paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
      }
      else
      {
        paramGraphics.drawLine(10, getHeight() - 11, 10, getHeight() - 4);
      }
      if (BorderPane.access$1000(this.this$0))
      {
        paramGraphics.drawLine(10, getHeight() / 2 - 3, 10, getHeight() / 2 + 3);
        if (this.horizontalActive)
        {
          arrayOfInt1 = new int[] { 3, 3, 10 };
          arrayOfInt2 = new int[] { getHeight() / 2 - 3, getHeight() / 2 + 3, getHeight() / 2 };
          paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
        }
        else
        {
          paramGraphics.drawLine(3, getHeight() / 2, 10, getHeight() / 2);
        }
      }
      if (this.rightActive)
      {
        arrayOfInt1 = new int[] { getWidth() - 14, getWidth() - 8, getWidth() - 11 };
        arrayOfInt2 = new int[] { getHeight() - 3, getHeight() - 3, getHeight() - 11 };
        paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
      }
      else
      {
        paramGraphics.drawLine(getWidth() - 11, getHeight() - 11, getWidth() - 11, getHeight() - 4);
      }
      if (this.bottomActive)
      {
        arrayOfInt1 = new int[] { getWidth() - 3, getWidth() - 11, getWidth() - 3 };
        arrayOfInt2 = new int[] { getHeight() - 14, getHeight() - 11, getHeight() - 8 };
        paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
      }
      else
      {
        paramGraphics.drawLine(getWidth() - 11, getHeight() - 11, getWidth() - 4, getHeight() - 11);
      }
      if (BorderPane.access$1000(this.this$0))
      {
        paramGraphics.drawLine(getWidth() / 2 - 3, getHeight() - 11, getWidth() / 2 + 3, getHeight() - 11);
        if (this.verticalActive)
        {
          arrayOfInt1 = new int[] { getWidth() / 2 - 3, getWidth() / 2 + 3, getWidth() / 2 };
          arrayOfInt2 = new int[] { getHeight() - 3, getHeight() - 3, getHeight() - 11 };
          paramGraphics.fillPolygon(arrayOfInt1, arrayOfInt2, 3);
        }
        else
        {
          paramGraphics.drawLine(getWidth() / 2, getHeight() - 11, getWidth() / 2, getHeight() - 4);
        }
      }
      if (BorderPane.access$1000(this.this$0))
      {
        int i = 4;
        int j = getWidth() / 2 - 20 - i;
        int k = getHeight() / 2 - 20 - i;
        paramGraphics.setColor(Color.lightGray);
        paramGraphics.fillRect(20, 20, j, k);
        paramGraphics.setColor(Color.lightGray);
        paramGraphics.fillRect(getWidth() / 2 + i + 1, 20, j, k);
        paramGraphics.setColor(Color.lightGray);
        paramGraphics.fillRect(20, getHeight() / 2 + i + 1, j, k);
        paramGraphics.setColor(Color.lightGray);
        paramGraphics.fillRect(getWidth() / 2 + i + 1, getHeight() / 2 + i + 1, j, k);
      }
      else
      {
        paramGraphics.setColor(Color.lightGray);
        paramGraphics.fillRect(20, 20, getWidth() - 40, getHeight() - 40);
      }
      updateBorders(paramGraphics);
    }

    public void addBorderChangeListener()
    {
      this.borderChangeListenerList.add((BorderPane.class$javax$swing$event$ChangeListener == null) ? (BorderPane.class$javax$swing$event$ChangeListener = BorderPane.class$("javax.swing.event.ChangeListener")) : BorderPane.class$javax$swing$event$ChangeListener, paramChangeListener);
    }

    public void fireBorderStateChanged()
    {
      Object[] arrayOfObject = this.borderChangeListenerList.getListenerList();
      ChangeEvent localChangeEvent = null;
      for (int i = arrayOfObject.length - 2; i >= 0; i -= 2)
        if (arrayOfObject[i] == ((BorderPane.class$javax$swing$event$ChangeListener == null) ? (BorderPane.class$javax$swing$event$ChangeListener = BorderPane.class$("javax.swing.event.ChangeListener")) : BorderPane.class$javax$swing$event$ChangeListener))
        {
          if (localChangeEvent == null)
            localChangeEvent = new ChangeEvent(this);
          ((ChangeListener)arrayOfObject[(i + 1)]).stateChanged(localChangeEvent);
        }
    }

    private void updateBorders()
    {
      Graphics2D localGraphics2D = (Graphics2D)paramGraphics;
      BorderPane.access$600(this.this$0).getColor();
      if ((BorderPane.access$400(this.this$0).getTopColor() != null) && (BorderPane.access$400(this.this$0).getTopStyle() != 0))
      {
        localGraphics2D.setColor(BorderPane.access$400(this.this$0).getTopColor());
        GraphHelper.drawLine(localGraphics2D, 15.0D, 15.0D, getWidth() - 15, 15.0D, BorderPane.access$400(this.this$0).getTopStyle());
      }
      if ((BorderPane.access$400(this.this$0).getLeftColor() != null) && (BorderPane.access$400(this.this$0).getLeftStyle() != 0))
      {
        localGraphics2D.setColor(BorderPane.access$400(this.this$0).getLeftColor());
        GraphHelper.drawLine(localGraphics2D, 15.0D, 15.0D, 15.0D, getHeight() - 15, BorderPane.access$400(this.this$0).getLeftStyle());
      }
      if ((BorderPane.access$400(this.this$0).getBottomColor() != null) && (BorderPane.access$400(this.this$0).getBottomStyle() != 0))
      {
        localGraphics2D.setColor(BorderPane.access$400(this.this$0).getBottomColor());
        GraphHelper.drawLine(localGraphics2D, 15.0D, getHeight() - 15, getWidth() - 15, getHeight() - 15, BorderPane.access$400(this.this$0).getBottomStyle());
      }
      if ((BorderPane.access$400(this.this$0).getRightColor() != null) && (BorderPane.access$400(this.this$0).getRightStyle() != 0))
      {
        localGraphics2D.setColor(BorderPane.access$400(this.this$0).getRightColor());
        GraphHelper.drawLine(localGraphics2D, getWidth() - 15, 15.0D, getWidth() - 15, getHeight() - 15, BorderPane.access$400(this.this$0).getRightStyle());
      }
      if ((BorderPane.access$400(this.this$0).getVerticalColor() != null) && (BorderPane.access$400(this.this$0).getVerticalStyle() != 0))
      {
        localGraphics2D.setColor(BorderPane.access$400(this.this$0).getVerticalColor());
        GraphHelper.drawLine(localGraphics2D, getWidth() / 2, 16.0D, getWidth() / 2, getHeight() - 16, BorderPane.access$400(this.this$0).getVerticalStyle());
      }
      if ((BorderPane.access$400(this.this$0).getHorizontalColor() != null) && (BorderPane.access$400(this.this$0).getHorizontalStyle() != 0))
      {
        localGraphics2D.setColor(BorderPane.access$400(this.this$0).getHorizontalColor());
        GraphHelper.drawLine(localGraphics2D, 16.0D, getHeight() / 2, getWidth() - 16, getHeight() / 2, BorderPane.access$400(this.this$0).getHorizontalStyle());
      }
      fireBorderStateChanged();
    }

    private void setActiveBorders()
    {
      switch (paramInt)
      {
      case 0:
        this.topActive = (this.leftActive = this.bottomActive = this.rightActive = this.verticalActive = this.horizontalActive = 0);
        break;
      case 1:
        this.topActive = (this.leftActive = this.bottomActive = this.rightActive = 1);
        this.verticalActive = (this.horizontalActive = 0);
        break;
      case 2:
        this.topActive = (this.leftActive = this.bottomActive = this.rightActive = 0);
        this.verticalActive = (this.horizontalActive = 1);
        break;
      case 3:
        this.topActive = true;
        this.leftActive = (this.bottomActive = this.rightActive = this.verticalActive = this.horizontalActive = 0);
        break;
      case 4:
        this.leftActive = true;
        this.topActive = (this.bottomActive = this.rightActive = this.verticalActive = this.horizontalActive = 0);
        break;
      case 5:
        this.bottomActive = true;
        this.topActive = (this.leftActive = this.rightActive = this.verticalActive = this.horizontalActive = 0);
        break;
      case 6:
        this.rightActive = true;
        this.topActive = (this.leftActive = this.bottomActive = this.verticalActive = this.horizontalActive = 0);
        break;
      case 7:
        this.verticalActive = true;
        this.topActive = (this.leftActive = this.bottomActive = this.rightActive = this.horizontalActive = 0);
        break;
      case 8:
        this.horizontalActive = true;
        this.topActive = (this.leftActive = this.bottomActive = this.rightActive = this.verticalActive = 0);
      }
    }

    static void access$300(BorderComponent paramBorderComponent)
    {
      paramBorderComponent.setActiveBorders(paramInt);
    }

    BorderComponent(, BorderPane.1 param1)
    {
      this(paramBorderPane);
    }

    static BorderPane access$900(BorderComponent paramBorderComponent)
    {
      return paramBorderComponent.this$0;
    }
  }

  private class BorderButtonIcon
    implements Icon
  {
    private int display;
    private final BorderPane this$0;

    private BorderButtonIcon(, int paramInt)
    {
      this.this$0 = paramBorderPane;
      this.display = paramInt;
    }

    public int getIconWidth()
    {
      return 32;
    }

    public int getIconHeight()
    {
      return 32;
    }

    public void paintIcon(, Graphics paramGraphics, int paramInt1, int paramInt2)
    {
      if (this.display == 1)
      {
        paramGraphics.setColor(Color.black);
        paramGraphics.drawRect(3, 3, getIconWidth() - 7, getIconHeight() - 7);
      }
      else if (this.display == 2)
      {
        paramGraphics.setColor(Color.black);
        paramGraphics.drawLine(getIconWidth() / 2, 3, getIconWidth() / 2, getIconHeight() - 4);
        paramGraphics.drawLine(3, getIconHeight() / 2, getIconWidth() - 4, getIconHeight() / 2);
        paramGraphics.setColor(Color.lightGray);
        paramGraphics.drawRect(3, 3, getIconWidth() - 7, getIconHeight() - 7);
      }
    }

    BorderButtonIcon(, int paramInt, BorderPane.1 param1)
    {
      this(paramBorderPane, paramInt);
    }
  }

  private class BorderButton extends JButton
  {
    private final BorderPane this$0;

    private BorderButton(, Icon paramIcon)
    {
      super(paramIcon);
      this.this$0 = paramBorderPane;
      setPreferredSize(new Dimension(32, 32));
      setFocusPainted(false);
    }

    BorderButton(, Icon paramIcon, BorderPane.1 param1)
    {
      this(paramBorderPane, paramIcon);
    }
  }

  private class ToggleButton extends JToggleButton
    implements ActionListener
  {
    private int borderType;
    private final BorderPane this$0;

    public ToggleButton(, Icon paramIcon, int paramInt)
    {
      super(paramIcon);
      this.this$0 = paramBorderPane;
      this.borderType = 0;
      this.borderType = paramInt;
      setPreferredSize(new Dimension(32, 32));
      addActionListener(this);
    }

    public void actionPerformed()
    {
      if (isSelected())
        BorderPane.BorderComponent.access$300(BorderPane.access$200(this.this$0), this.borderType);
      else
        BorderPane.BorderComponent.access$300(BorderPane.access$200(this.this$0), 0);
      switch (this.borderType)
      {
      case 3:
        if (isSelected())
        {
          if ((BorderPane.access$400(this.this$0).getTopStyle() == BorderPane.access$700(this.this$0).getSelectedLineStyle()) && (BorderPane.access$400(this.this$0).getTopColor() == BorderPane.access$600(this.this$0).getColor()))
          {
            BorderPane.access$400(this.this$0).setTopStyle(0);
            BorderPane.access$400(this.this$0).setTopColor(Color.WHITE);
          }
          else
          {
            BorderPane.access$400(this.this$0).setTopColor(BorderPane.access$600(this.this$0).getColor());
            BorderPane.access$400(this.this$0).setTopStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          }
        }
        else if ((BorderPane.access$400(this.this$0).getTopStyle() == 0) && (BorderPane.access$400(this.this$0).getTopColor() == Color.WHITE))
        {
          BorderPane.access$400(this.this$0).setTopStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          BorderPane.access$400(this.this$0).setTopColor(BorderPane.access$600(this.this$0).getColor());
        }
        else
        {
          BorderPane.access$400(this.this$0).setTopColor(Color.BLACK);
          BorderPane.access$400(this.this$0).setTopStyle(0);
        }
        break;
      case 8:
        if (isSelected())
        {
          if ((BorderPane.access$400(this.this$0).getHorizontalStyle() == BorderPane.access$700(this.this$0).getSelectedLineStyle()) && (BorderPane.access$400(this.this$0).getHorizontalColor() == BorderPane.access$600(this.this$0).getColor()))
          {
            BorderPane.access$400(this.this$0).setHorizontalStyle(0);
            BorderPane.access$400(this.this$0).setHorizontalColor(Color.WHITE);
          }
          else
          {
            BorderPane.access$400(this.this$0).setHorizontalColor(BorderPane.access$600(this.this$0).getColor());
            BorderPane.access$400(this.this$0).setHorizontalStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          }
        }
        else if ((BorderPane.access$400(this.this$0).getHorizontalStyle() == 0) && (BorderPane.access$400(this.this$0).getHorizontalColor() == Color.WHITE))
        {
          BorderPane.access$400(this.this$0).setHorizontalStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          BorderPane.access$400(this.this$0).setHorizontalColor(BorderPane.access$600(this.this$0).getColor());
        }
        else
        {
          BorderPane.access$400(this.this$0).setHorizontalColor(Color.BLACK);
          BorderPane.access$400(this.this$0).setHorizontalStyle(0);
        }
        break;
      case 5:
        if (isSelected())
        {
          if ((BorderPane.access$400(this.this$0).getBottomStyle() == BorderPane.access$700(this.this$0).getSelectedLineStyle()) && (BorderPane.access$400(this.this$0).getBottomColor() == BorderPane.access$600(this.this$0).getColor()))
          {
            BorderPane.access$400(this.this$0).setBottomStyle(0);
            BorderPane.access$400(this.this$0).setBottomColor(Color.WHITE);
          }
          else
          {
            BorderPane.access$400(this.this$0).setBottomColor(BorderPane.access$600(this.this$0).getColor());
            BorderPane.access$400(this.this$0).setBottomStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          }
        }
        else if ((BorderPane.access$400(this.this$0).getBottomStyle() == 0) && (BorderPane.access$400(this.this$0).getBottomColor() == Color.WHITE))
        {
          BorderPane.access$400(this.this$0).setBottomStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          BorderPane.access$400(this.this$0).setBottomColor(BorderPane.access$600(this.this$0).getColor());
        }
        else
        {
          BorderPane.access$400(this.this$0).setBottomColor(Color.BLACK);
          BorderPane.access$400(this.this$0).setBottomStyle(0);
        }
        break;
      case 4:
        if (isSelected())
        {
          if ((BorderPane.access$400(this.this$0).getLeftStyle() == BorderPane.access$700(this.this$0).getSelectedLineStyle()) && (BorderPane.access$400(this.this$0).getLeftColor() == BorderPane.access$600(this.this$0).getColor()))
          {
            BorderPane.access$400(this.this$0).setLeftStyle(0);
            BorderPane.access$400(this.this$0).setLeftColor(Color.WHITE);
          }
          else
          {
            BorderPane.access$400(this.this$0).setLeftColor(BorderPane.access$600(this.this$0).getColor());
            BorderPane.access$400(this.this$0).setLeftStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          }
        }
        else if ((BorderPane.access$400(this.this$0).getLeftStyle() == 0) && (BorderPane.access$400(this.this$0).getLeftColor() == Color.WHITE))
        {
          BorderPane.access$400(this.this$0).setLeftStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          BorderPane.access$400(this.this$0).setLeftColor(BorderPane.access$600(this.this$0).getColor());
        }
        else
        {
          BorderPane.access$400(this.this$0).setLeftColor(Color.BLACK);
          BorderPane.access$400(this.this$0).setLeftStyle(0);
        }
        break;
      case 7:
        if (isSelected())
        {
          if ((BorderPane.access$400(this.this$0).getVerticalStyle() == BorderPane.access$700(this.this$0).getSelectedLineStyle()) && (BorderPane.access$400(this.this$0).getVerticalColor() == BorderPane.access$600(this.this$0).getColor()))
          {
            BorderPane.access$400(this.this$0).setVerticalStyle(0);
            BorderPane.access$400(this.this$0).setVerticalColor(Color.WHITE);
          }
          else
          {
            BorderPane.access$400(this.this$0).setVerticalColor(BorderPane.access$600(this.this$0).getColor());
            BorderPane.access$400(this.this$0).setVerticalStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          }
        }
        else if ((BorderPane.access$400(this.this$0).getVerticalStyle() == 0) && (BorderPane.access$400(this.this$0).getVerticalColor() == Color.WHITE))
        {
          BorderPane.access$400(this.this$0).setVerticalStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          BorderPane.access$400(this.this$0).setVerticalColor(BorderPane.access$600(this.this$0).getColor());
        }
        else
        {
          BorderPane.access$400(this.this$0).setVerticalColor(Color.BLACK);
          BorderPane.access$400(this.this$0).setVerticalStyle(0);
        }
        break;
      case 6:
        if (isSelected())
        {
          if ((BorderPane.access$400(this.this$0).getRightStyle() == BorderPane.access$700(this.this$0).getSelectedLineStyle()) && (BorderPane.access$400(this.this$0).getRightColor() == BorderPane.access$600(this.this$0).getColor()))
          {
            BorderPane.access$400(this.this$0).setRightStyle(0);
            BorderPane.access$400(this.this$0).setRightColor(Color.WHITE);
          }
          else
          {
            BorderPane.access$400(this.this$0).setRightColor(BorderPane.access$600(this.this$0).getColor());
            BorderPane.access$400(this.this$0).setRightStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          }
        }
        else if ((BorderPane.access$400(this.this$0).getRightStyle() == 0) && (BorderPane.access$400(this.this$0).getRightColor() == Color.WHITE))
        {
          BorderPane.access$400(this.this$0).setRightStyle(BorderPane.access$700(this.this$0).getSelectedLineStyle());
          BorderPane.access$400(this.this$0).setRightColor(BorderPane.access$600(this.this$0).getColor());
        }
        else
        {
          BorderPane.access$400(this.this$0).setRightColor(Color.BLACK);
          BorderPane.access$400(this.this$0).setRightStyle(0);
        }
      }
      BorderPane.access$200(this.this$0).repaint();
    }
  }

  public static class BorderStyleColor
  {
    private int style;
    private Color color;

    public BorderStyleColor(int paramInt, Color paramColor)
    {
      setStyle(paramInt);
      setColor(paramColor);
    }

    public Color getColor()
    {
      return this.color;
    }

    public void setColor(Color paramColor)
    {
      this.color = paramColor;
    }

    public int getStyle()
    {
      return this.style;
    }

    public void setStyle(int paramInt)
    {
      this.style = paramInt;
    }

    public boolean equals(Object paramObject)
    {
      if (!(paramObject instanceof BorderStyleColor))
        break label39;
      BorderStyleColor localBorderStyleColor = (BorderStyleColor)paramObject;
      label39: return ((getStyle() == localBorderStyleColor.getStyle()) && (ComparatorUtils.equals(getColor(), localBorderStyleColor.getColor())));
    }
  }

  public static class ColumnRow
  {
    private int column;
    private int row;
    private boolean isVertical;

    public ColumnRow()
    {
      this(-1, -1, true);
    }

    public ColumnRow(int paramInt1, int paramInt2, boolean paramBoolean)
    {
      this.column = -1;
      this.row = -1;
      this.isVertical = true;
      this.column = paramInt1;
      this.row = paramInt2;
      this.isVertical = paramBoolean;
    }

    public int getColumn()
    {
      return this.column;
    }

    public void setColumn(int paramInt)
    {
      this.column = paramInt;
    }

    public void setRow(int paramInt)
    {
      this.row = paramInt;
    }

    public int getRow()
    {
      return this.row;
    }

    public int hashCode()
    {
      return toString().hashCode();
    }

    public boolean equals(Object paramObject)
    {
      if (!(paramObject instanceof ColumnRow))
        break label36;
      ColumnRow localColumnRow = (ColumnRow)paramObject;
      label36: return ((getColumn() == localColumnRow.getColumn()) && (getRow() == localColumnRow.getRow()));
    }

    public String toString()
    {
      if (this.isVertical)
        return "ColumnRow[" + getColumn() + ", " + getRow() + ", vertical]";
      return "ColumnRow[" + getColumn() + ", " + getRow() + ", horizontal]";
    }
  }
}